/* Custom styles for Go Interview Practice web UI */

/* Color schemes for difficulty badges */
.badge-beginner {
    background-color: #28a745 !important;
}

.badge-intermediate {
    background-color: #ffc107 !important;
    color: #212529 !important;
}

.badge-advanced {
    background-color: #dc3545 !important;
}

/* Learning materials highlighting styles */
.highlighting-controls {
    border: 1px solid #e9ecef !important;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border-radius: 8px !important;
}

.highlighting-controls .btn {
    transition: all 0.2s ease;
    border-radius: 6px;
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
}

.highlighting-controls .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Color options styling */
.color-options {
    display: flex;
    gap: 4px;
}

.color-btn {
    width: 20px;
    height: 20px;
    border: 2px solid #dee2e6;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    background: none;
    padding: 0;
}

.color-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.color-btn.active {
    border-color: #495057;
    box-shadow: 0 0 0 2px rgba(73, 80, 87, 0.2);
}

.color-btn.active::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #495057;
    font-size: 10px;
    font-weight: bold;
    text-shadow: 0 0 2px white;
}

.highlighted-text {
    border-radius: 3px;
    padding: 1px 3px;
    margin: 0 1px;
    transition: all 0.2s ease;
    position: relative;
    font-weight: 500;
    display: inline-block;
}

.highlighted-text:hover {
    filter: brightness(1.1);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.highlighted-text:hover .highlight-delete-btn {
    opacity: 1;
    transform: scale(1);
}

.highlight-delete-btn {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 16px;
    height: 16px;
    background-color: #dc3545;
    color: white;
    border: 1px solid white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    cursor: pointer;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.2s ease;
    z-index: 10;
    line-height: 1;
}

.highlight-delete-btn:hover {
    background-color: #c82333;
    transform: scale(1.1);
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.highlighted-text::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    pointer-events: none;
}

/* Highlight color variations */
.highlighted-text[style*="background-color: #ffeb3b"] {
    background-color: #ffeb3b !important;
    color: #000;
}

.highlighted-text[style*="background-color: #ffcdd2"] {
    background-color: #ffcdd2 !important;
    color: #000;
}

.highlighted-text[style*="background-color: #c8e6c9"] {
    background-color: #c8e6c9 !important;
    color: #000;
}

.highlighted-text[style*="background-color: #bbdefb"] {
    background-color: #bbdefb !important;
    color: #000;
}

/* Learning materials container */
#learning-materials {
    position: relative;
    user-select: text;
}

#learning-materials.highlight-mode {
    cursor: crosshair;
}

#learning-materials.highlight-mode * {
    cursor: crosshair;
}

#learning-materials.highlight-mode pre,
#learning-materials.highlight-mode code {
    cursor: default;
}

/* Highlight controls responsive design */
@media (max-width: 768px) {
    .highlighting-controls .d-flex {
        flex-direction: column;
        gap: 8px;
    }
    
    .highlighting-controls .d-flex > div {
        width: 100%;
        justify-content: center;
    }
    
    .highlighting-controls .btn {
        font-size: 0.75rem;
        padding: 0.2rem 0.4rem;
    }
    
    .color-btn {
        width: 18px;
        height: 18px;
    }
}

/* Challenge cards styling */
.challenge-card {
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(0, 0, 0, 0.125);
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.challenge-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 0, 0, 0.2);
}

.challenge-card .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.challenge-card .card-title {
    font-weight: 600;
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: #212529;
}

.challenge-card .card-subtitle {
    margin-bottom: 1rem;
}

.challenge-card .card-text {
    flex: 1;
    overflow: hidden;
    margin-bottom: 1rem;
    color: #6c757d;
    font-size: 0.95rem;
    line-height: 1.5;
}

.challenge-description {
    min-height: 4.5rem;
    max-height: 6rem;
    overflow: hidden;
    position: relative;
}

.challenge-description p {
    margin-bottom: 0;
}

/* Code editor styling */
.editor-container {
    width: 100%;
    height: 500px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 15px;
}

/* Markdown content styling */
.markdown-content {
    line-height: 1.6;
    overflow-wrap: break-word;
}

.markdown-content h1 {
    font-size: 1.8rem;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid #eaecef;
}

.markdown-content h2 {
    font-size: 1.5rem;
    margin-top: 1.2rem;
    margin-bottom: 0.8rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid #eaecef;
}

.markdown-content h3 {
    font-size: 1.2rem;
    margin-top: 1rem;
    margin-bottom: 0.8rem;
}

.markdown-content pre {
    padding: 16px;
    overflow: auto;
    font-size: 85%;
    line-height: 1.45;
    background-color: #f6f8fa;
    border-radius: 3px;
    margin-bottom: 16px;
}

.markdown-content code {
    font-family: SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace;
    padding: 0.2em 0.4em;
    margin: 0;
    font-size: 85%;
    background-color: rgba(27, 31, 35, 0.05);
    border-radius: 3px;
}

.markdown-content pre code {
    background-color: transparent;
    padding: 0;
}

.markdown-content blockquote {
    padding: 0 1em;
    color: #6a737d;
    border-left: 0.25em solid #dfe2e5;
    margin: 0 0 16px 0;
}

.markdown-content ul, 
.markdown-content ol {
    padding-left: 2em;
    margin-bottom: 16px;
}

.markdown-content img {
    max-width: 100%;
    box-sizing: border-box;
}

.markdown-content table {
    display: block;
    width: 100%;
    overflow: auto;
    margin-bottom: 16px;
}

.markdown-content table th,
.markdown-content table td {
    padding: 6px 13px;
    border: 1px solid #dfe2e5;
}

.markdown-content table tr {
    background-color: #fff;
    border-top: 1px solid #c6cbd1;
}

.markdown-content table tr:nth-child(2n) {
    background-color: #f6f8fa;
}

/* Test results styling */
.test-results {
    font-family: SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
    overflow-x: auto;
}

.test-success {
    color: #28a745;
    font-weight: bold;
}

.test-failure {
    color: #dc3545;
    font-weight: bold;
}

/* Loading indicator */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #09f;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Button styling */
.btn-run {
    background-color: #007bff;
    color: white;
}

.btn-submit {
    background-color: #28a745;
    color: white;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .editor-container {
        height: 300px;
    }
    
    .navbar-brand {
        font-size: 1.2rem;
    }
}

/* Fix for the navbar on small screens */
@media (max-width: 576px) {
    body {
        padding-top: 4.5rem;
    }
}

/* Go language syntax highlighting specific styles */
.markdown-content pre code.language-go,
.markdown-content pre code.language-golang {
    display: block;
    overflow-x: auto;
    padding: 1em;
    color: #333;
    background: #f8f8f8;
}

/* Style for Go keywords */
.hljs-keyword,
.hljs-selector-tag,
.hljs-type {
    color: #00579E;
    font-weight: bold;
}

/* Style for Go functions and methods */
.hljs-title,
.hljs-title.function_ {
    color: #4078F2;
}

/* Style for Go strings */
.hljs-string,
.hljs-quote {
    color: #008000;
}

/* Style for Go comments */
.hljs-comment {
    color: #999988;
    font-style: italic;
}

/* Style for Go numbers */
.hljs-number,
.hljs-literal {
    color: #005CC5;
}

/* Hints system styling */
.hint-item {
    border-left: 4px solid #ffc107;
    background-color: #fff3cd;
    border-color: #ffeaa7;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    width: 100%;
    min-width: 0;
}

.hint-item .badge {
    font-size: 0.75rem;
    min-width: 60px;
}

/* Enhanced inline code styling for hints */
.hint-item code {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #e83e8c;
    padding: 3px 8px;
    border-radius: 6px;
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    font-weight: 600;
    font-size: 0.9em;
    border: 1px solid rgba(232, 62, 140, 0.2);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: inline-block;
    margin: 0 2px;
}

.hint-item pre {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 16px;
    margin: 12px 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow-x: auto;
    overflow-y: hidden;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    white-space: pre;
    scrollbar-width: thin;
    scrollbar-color: #64748b #334155;
}

/* Custom scrollbar for code blocks */
.hint-item pre::-webkit-scrollbar {
    height: 8px;
}

.hint-item pre::-webkit-scrollbar-track {
    background: #1e293b;
    border-radius: 4px;
}

.hint-item pre::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, #64748b 0%, #475569 100%);
    border-radius: 4px;
    border: 1px solid #334155;
}

.hint-item pre::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(90deg, #475569 0%, #374151 100%);
}

.hint-item pre::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 32px;
    background: linear-gradient(90deg, #ef4444 0%, #f59e0b 33%, #10b981 66%, #3b82f6 100%);
    border-radius: 8px 8px 0 0;
    opacity: 0.8;
}

.hint-item pre::after {
    content: '●●●';
    position: absolute;
    top: 8px;
    left: 12px;
    color: #1e293b;
    font-size: 12px;
    z-index: 1;
}

.hint-item pre code {
    background: transparent;
    color: #e2e8f0;
    padding: 0;
    border: none;
    box-shadow: none;
    display: block;
    margin-top: 16px;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre;
}

/* Syntax highlighting for hint code blocks */
.hint-item .hljs-keyword,
.hint-item .hljs-selector-tag,
.hint-item .hljs-type {
    color: #f472b6;
    font-weight: 600;
}

.hint-item .hljs-title,
.hint-item .hljs-title.function_ {
    color: #60a5fa;
}

.hint-item .hljs-string,
.hint-item .hljs-quote {
    color: #34d399;
}

.hint-item .hljs-comment {
    color: #94a3b8;
    font-style: italic;
}

.hint-item .hljs-number,
.hint-item .hljs-literal {
    color: #fbbf24;
}

.hint-item .hljs-variable,
.hint-item .hljs-name {
    color: #a78bfa;
}

/* Ensure hint markdown content is properly contained */
.hint-item .markdown-content {
    overflow: hidden;
    width: 100%;
    min-width: 0;
}

/* Hints animation */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hint-item {
    animation: slideIn 0.3s ease-in-out;
}

/* Hints tab icon styling */
#hints-tab .bi-lightbulb {
    color: #ffc107;
}

/* Hints progress styling */
#hints-content .text-muted {
    font-size: 0.875rem;
}

/* Hints buttons styling */
#show-hint-btn {
    border-color: #ffc107;
    color: #ffc107;
}

#show-hint-btn:hover {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #212529;
}

#reset-hints-btn {
    border-color: #6c757d;
    color: #6c757d;
}

/* Enhanced Challenge Cards for Package Detail - Matching Home Page */
.challenge-card {
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.125);
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.challenge-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 0, 0, 0.2);
}

.challenge-card.attempted-challenge {
    border-left: 4px solid #28a745;
    background: #e8f5e8;
}

.challenge-card.attempted-challenge .card-header {
    background: #e8f5e8;
}

.challenge-card .card-header {
    background: #f8f9fa;
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
}

.challenge-card .card-title {
    font-weight: 600;
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: #212529;
    line-height: 1.3;
}

.challenge-card .card-text {
    flex: 1;
    overflow: hidden;
    margin-bottom: 1rem;
    color: #6c757d;
}

.challenge-card .badge {
    font-size: 0.75rem;
    font-weight: 500;
}

.challenge-card .card-footer {
    background: transparent;
    border-top: 1px solid rgba(0, 0, 0, 0.125);
}

.challenge-card .btn {
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.4rem 0.8rem;
}

/* Hover effects matching home page */
.challenge-card:hover .card-header {
    background: #e9ecef;
}

.challenge-card.attempted-challenge:hover .card-header {
    background: #e8f5e8;
}

/* Compact Prerequisites & Real-World Usage Styles */
.prerequisites-container,
.usage-container {
    background: #fff;
    border-radius: 8px;
    padding: 1.25rem;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.section-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e9ecef;
}

.section-header .icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    font-size: 0.9rem;
    color: white;
}

.section-header.prerequisites .icon {
    background: #28a745;
}

.section-header.usage .icon {
    background: #17a2b8;
}

.section-header h5 {
    margin: 0;
    font-weight: 600;
    font-size: 1rem;
    color: #495057;
}

.section-header p {
    display: none;
}

.prerequisite-item,
.usage-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
}

.prerequisite-item:hover,
.usage-item:hover {
    background: #e9ecef;
    border-color: #dee2e6;
}

.prerequisite-item .icon,
.usage-item .icon {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    font-size: 0.75rem;
    color: white;
}

.prerequisite-item .icon {
    background: #28a745;
}

.usage-item .icon {
    background: #17a2b8;
}

.usage-item .icon.rest-api {
    background: #dc3545;
}

.usage-item .icon.microservices {
    background: #ffc107;
}

.usage-item .icon.web-apps {
    background: #28a745;
}

.usage-item .icon.database {
    background: #6f42c1;
}

.usage-item .icon.ecommerce {
    background: #fd7e14;
}

.usage-item .icon.user-management {
    background: #20c997;
}

.usage-item .icon.devops {
    background: #6f42c1;
}

.usage-item .icon.cli {
    background: #495057;
}

.usage-item .icon.system-admin {
    background: #dc3545;
}

.usage-item .icon.high-traffic {
    background: #28a745;
}

.usage-item .icon.real-time {
    background: #ffc107;
}

.usage-item .icon.microservices-arch {
    background: #17a2b8;
}

.prerequisite-item .text,
.usage-item .text {
    font-weight: 500;
    color: #495057;
    font-size: 0.875rem;
    margin: 0;
}

.empty-state {
    text-align: center;
    padding: 1rem;
}

.empty-state .icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.5rem;
    font-size: 1rem;
    color: white;
    background: #6c757d;
}

.empty-state h6 {
    color: #6c757d;
    font-weight: 600;
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
}

.empty-state p {
    color: #adb5bd;
    font-size: 0.8rem;
    margin: 0;
}

/* Sponsor Button Styles */
.btn-sponsor {
    background: linear-gradient(135deg, #ea4aaa 0%, #ff6b9d 100%) !important;
    color: white !important;
    border: none !important;
    border-radius: 20px !important;
    font-size: 0.85rem !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 2px 4px rgba(234, 74, 170, 0.3) !important;
    text-decoration: none !important;
}

.btn-sponsor:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 8px rgba(234, 74, 170, 0.4) !important;
    color: white !important;
    text-decoration: none !important;
}

.btn-sponsor:focus {
    outline: none !important;
    box-shadow: 0 4px 8px rgba(234, 74, 170, 0.4), 0 0 0 3px rgba(234, 74, 170, 0.2) !important;
}

.btn-sponsor:active {
    transform: translateY(0) !important;
}

/* GitHub Stats Section */
.github-stats {
    gap: 1rem;
    max-width: 300px;
    margin: 0 auto;
    justify-content: center !important;
}

/* Premium Sponsors Section */
.sponsors-container {
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2rem;
}

.sponsor-logo {
    height: 50px;
    max-width: 150px;
    object-fit: contain;
    filter: grayscale(100%);
    opacity: 0.7;
    transition: all 0.3s ease;
}

.sponsor-logo:hover {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1.05);
}

@media (max-width: 576px) {
    .github-stats {
        gap: 0.75rem;
    }
    
    .btn-sponsor {
        font-size: 0.8rem !important;
        padding: 0.4rem 0.8rem !important;
    }
    
    .sponsors-container {
        gap: 1rem;
    }
    
    .sponsor-logo {
        height: 40px;
        max-width: 120px;
    }
}

@media (max-width: 768px) {
    .prerequisites-container,
    .usage-container {
        padding: 1rem;
    }
    
    .prerequisite-item,
    .usage-item {
        padding: 0.5rem 0.75rem;
    }
} 